home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
FM Towns: Free Software Collection 7
/
FM Towns Free Software Collection 7.iso
/
t_os
/
gpen32k
/
source.exe
/
LSRC
/
CMP.C
next >
Wrap
Text File
|
1993-03-24
|
920b
|
50 lines
/* 新しさのチェック */
/* 古い方を返す */
#include <dos.h>
#include <stdlib.h>
#include <string.h>
#include <direct.h>
#include <ctype.h>
#ifdef LSI_C
#define _MAX_PATH 144
#define _MAX_DRIVE 3
#define _MAX_DIR 130
#define _MAX_FNAME 9
#define _MAX_EXT 5
#endif
void main( int argc, char *argv[] )
{
char dr[_MAX_DRIVE], di[_MAX_DIR], fn[_MAX_FNAME], ex[_MAX_EXT];
unsigned int a;
struct find_t ff;
struct find_t fs;
if (argc != 3)
exit(1);
_splitpath( argv[1], dr, di, fn, ex );
if ( strlen(dr)>1 )
{
_dos_setdrive( toupper(dr[0])-'A'+1, &a );
}
if ( strlen(di) )
{
di[strlen(di)-1] = 0;
chdir( di );
}
if (_dos_findfirst( argv[1], _A_NORMAL, &ff)==0 &&
_dos_findfirst( argv[2], _A_NORMAL, &fs)==0) {
if ((ff.wr_date < fs.wr_date) ||
(ff.wr_date == fs.wr_date && ff.wr_time < fs.wr_time)) {
exit(2);
}
exit(3);
}
exit(1);
}